package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class 纸张尺寸 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       static char op[]=new char[2];
       static int n;
       
       public static void main(String[] args) throws IOException {
		      br.read(op,0,2);
		      n=op[1]-'0';
		      int l=1189,w=841;
		      while(n-->0){
		    	  int t=l/2;
		    	  if(t<w){
		    		  l=w;
		    		  w=t;
		    	  }else{
		    		  l=t;
		    	  }
		      }
		      System.out.println(l);
		      System.out.println(w);
	}
       
}
